package com.intelij.adapter.eums;

import java.util.stream.Stream;

public enum SourceType {
    UML_SUPPORT("uml");
    private String extName;

    SourceType(String extName) {
        this.extName = extName;
    }

    public static SourceType getSourceTypeByExt(String extName){
        return Stream.of(SourceType.values()).filter(t -> t.getExtName().equals(extName)).findFirst().orElse(null);
    }

    public static SourceType getSourceTypeByName(String name) {
        return Stream.of(SourceType.values()).filter(t -> t.name().equals(name)).findFirst().orElse(null);
    }

    public String getExtName() {
        return extName;
    }

    public void setExtName(String extName) {
        this.extName = extName;
    }
}
